<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>添加</title>
    <#assign base=request.contextPath  />
    <base id="base" href="${base}">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, adminUser-scalable=0">
    <link rel="stylesheet" href="${base}/static/win10/component/layui/css/layui.css" media="all">
    <script>
        var base =  "${base}";
    </script>
</head>
<body>
<br>
<form class="layui-form " action="">
         <input type="hidden" id="id" name="id" value="${managementDateNo.id!}" >
          <div class="layui-form-item">
              <label class="layui-form-label">处置单号</label>
              <div class="layui-input-block">
                  <input type="text" id="managementOddNumber" name="managementOddNumber" value="${managementDateNo.managementOddNumber!}"  autocomplete="off" placeholder="请输入处置单号"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">处置状态 1待审批/2审批通过/3审批不通过</label>
              <div class="layui-input-block">
                  <input type="text" id="managementState" name="managementState" value="${managementDateNo.managementState!}"  autocomplete="off" placeholder="请输入处置状态 1待审批/2审批通过/3审批不通过"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">处置物品状态值 1调出/2已报废/3借出(校外)</label>
              <div class="layui-input-block">
                  <input type="text" id="goodsState" name="goodsState" value="${managementDateNo.goodsState!}"  autocomplete="off" placeholder="请输入处置物品状态值 1调出/2已报废/3借出(校外)"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">不通过原因</label>
              <div class="layui-input-block">
                  <input type="text" id="managementReason" name="managementReason" value="${managementDateNo.managementReason!}"  autocomplete="off" placeholder="请输入不通过原因"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">处置审批人</label>
              <div class="layui-input-block">
                  <input type="text" id="managementApprovalUserId" name="managementApprovalUserId" value="${managementDateNo.managementApprovalUserId!}"  autocomplete="off" placeholder="请输入处置审批人"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">更改日期</label>
              <div class="layui-input-block">
                  <input type="text" id="updateTime" name="updateTime" value="${managementDateNo.updateTime!}"  autocomplete="off" placeholder="请输入更改日期"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">申领日期</label>
              <div class="layui-input-block">
                  <input type="text" id="createTime" name="createTime" value="${managementDateNo.createTime!}"  autocomplete="off" placeholder="请输入申领日期"
                         class="layui-input">
              </div>
          </div>

    <div align="center">
        <button type="button" class="layui-btn" id="submit">保存</button>
    </div>
</form>

<script src="${base}/static/win10/component/layui/layui.js?t=1"></script>
<script src="${base}/static/win10/js/jquery-1.8.3.min.js?t=1"></script>
<script>
    layui.use(['form', 'layer'], function() {
        var form = layui.form
                , layer = layui.layer;
        $("#submit").on("click",function () {
            if(check()===false){
                return;
            }

            var formDate = {
                         id:$("#id").val(),
                         managementOddNumber:$("#managementOddNumber").val(),
                         managementState:$("#managementState").val(),
                         goodsState:$("#goodsState").val(),
                         managementReason:$("#managementReason").val(),
                         managementApprovalUserId:$("#managementApprovalUserId").val(),
                         updateTime:$("#updateTime").val(),
                           createTime:$("#createTime").val()
            }
            $.ajax({
                type: "POST",
                url: base+"/api/managementDateNo/admin/editManagementDateNo",
                data: formDate,
                success: function (data) {
                    layer.msg(data.message)
                    if (data.code === 200) {
                        window.location.href=base+"/api/managementDateNo/admin/main.html"
                    } else {

                    }
                }
            });
        })







        function check(){
                   if($("#managementOddNumber").val().length<1){
                       layer.msg("请输入处置单号");
                       return false;
                   }
                   if($("#managementState").val().length<1){
                       layer.msg("请输入处置状态 1待审批/2审批通过/3审批不通过");
                       return false;
                   }
                   if($("#goodsState").val().length<1){
                       layer.msg("请输入处置物品状态值 1调出/2已报废/3借出(校外)");
                       return false;
                   }
                   if($("#managementReason").val().length<1){
                       layer.msg("请输入不通过原因");
                       return false;
                   }
                   if($("#managementApprovalUserId").val().length<1){
                       layer.msg("请输入处置审批人");
                       return false;
                   }
                   if($("#updateTime").val().length<1){
                       layer.msg("请输入更改日期");
                       return false;
                   }
                   if($("#createTime").val().length<1){
                       layer.msg("请输入申领日期");
                       return false;
                   }
        }
    });

</script>
</body>
</html>